package com.miyu.system.service.data.impl;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * Redis类型
 * @author miyu
 * @date 2023/10/14
 */
@Getter
@ToString
@AllArgsConstructor
public enum RedisType {
    /** 系统 */
    SYSTEM("system","系统"),
    /** 书 */
    BOOK("book","书籍"),
    /** 视频 */
    VIDEO("video","视频"),
    /** 图片 */
    IMAGE("image","图片"),
    /** 音乐 */
    MUSIC("music","音乐"),
    /** 日志 */
    LOG("log","日志");


    private String code;
    private String name;

    public static String getInfoByCode(String code) {
        String name = "";
        for (RedisType s : values()) {
            if (s.getCode().equals(code)) {
                name = s.getName();
                break;
            }
        }
        return name;
    }
}
